import { RouteRecordRaw } from "vue-router";
import Home from "../Layout.vue";
import Login from "../views/Login.vue";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "Home",
    component: Home,
    redirect: "/system/index",
    children: [
      //系统管理模块
      {
        path: "/system/index",
        name: "Index",
        component: () => import("@/views/system-setting/index.vue")
      },
      {
        path: "/system/version",
        name: "Version",
        component: () => import("@/views/system-setting/VersionManage.vue")
      },

      //用户管理模块
      {
        path: "/users/permission",
        name: "Permission",
        component: () => import("@/views/user-center/PermissionManage.vue")
      },
      {
        path: "/users/role",
        name: "Role",
        component: () => import("@/views/user-center/RoleManage.vue")
      },
      {
        path: "/users/user",
        name: "User",
        component: () => import("@/views/user-center/UserManage.vue")
      },

      //设备管理
      {
        path: "/devices/deviceList",
        name: "DeviceList",
        component: () => import("@/views/device-manage/DeviceList.vue")
      },

      //订单管理
      {
        path: "/orders/orderList",
        name: "OrderList",
        component: () => import("@/views/order-manage/OrderList.vue")
      },
      {
        path: "/orders/orderDetailList",
        name: "orderDetailList",
        component: () => import("@/views/order-manage/OrderDetailList.vue")
      },

      //短信管理
      {
        path: "/messages/messageList",
        name: "MessageList",
        component: () => import("@/views/message-manage/MessageList.vue")
      },
      {
        path: "/messages/voiceList",
        name: "VoiceList",
        component: () => import("@/views/message-manage/VoiceMessageList.vue")
      },
      {
        path: "/system/phoneMessage",
        name: "NotFound",
        component: () => import("@/NotFound.vue")
      },


      //用户反馈
      {
        path: "/system/feedback",
        name: "FeedbackManage",
        component: ()=>import("@/views/system-setting/FeedbackManage.vue")
      },

      //版本管理
      {
        path: "/system/version",
        name: "VersionManage",
        component:()=> import("@/views/system-setting/VersionManage.vue")
      }

      //暂无功能
    ]
  },
  {
    path: "/login",
    name: "Login",
    component: Login
  }
];

export { routes };
